<?php

class FriendFriendListAction extends SzAbstractAction
{
    Protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * 获取好友列表
     *
     * @param int $userId
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $reqTime)
    {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_FRIEND_FUNC)) {
            return $this->buildResponse(false);
        }

        $friendInfoList = FriendService::get()->getFriendInfoList($userId);
        $requestInfoList = FriendService::get()->getRequestInfoList($userId, $reqTime);
        $recommendList = FriendService::get()->getFriendRecommendList($userId);
        return $this->buildResponse([
            'friendList' => $friendInfoList,
            'requestList' => $requestInfoList,
            'recommendList' => $recommendList
        ]);
    }
}